package com.zkthink.ceres.common.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

@Getter
public enum MainRelativeEnum {
    MOM_RELATIVE(1, "母亲"),
    DAD_RELATIVE(2, "父亲"),
    SISTER_RELATIVE(3, "姐姐"),
    GRANDMOTHER_RELATIVE(4, "奶奶"),
    GRANDMOTHER2_RELATIVE(5, "姥姥"),
    AUNT_RELATIVE(6, "大姑"),
    ANUT2_RELATIVE(7, "大姨");

    private int code;

    private String desc;

    MainRelativeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static MainRelativeEnum getDscByType(Integer type) {
        for (MainRelativeEnum p : values()) {
            if (p.getCode() == type.intValue()) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }
}
